﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using SmartMeterParamFrame;

namespace SchemeManager
{
    /// <summary>
    /// SchemeNameInput.xaml 的交互逻辑
    /// </summary>
    public partial class SchemeNameInput : Window
    {
        public SchemeNameInput()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 输入的方案名称
        /// </summary>
        public string SchemeName { get; set; }

        /// <summary>
        /// 方案类型
        /// </summary>
        public EnumCheckType SchemeOperationType
        {
            get;
            set;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button btnSource = sender as Button;
            if (btnSource == null) return;
            if (btnSource.Name == "btnOk")
            {
                if (txtSchemeName.Text.Trim() == string.Empty)
                {
                    MessageBox.Show("请输入有效的方案名称，如：我的方案");
                    return;
                }
                SchemeName = txtSchemeName.Text.Trim();
                if (this.cbOperationType.IsChecked == true)
                {
                    this.SchemeOperationType = EnumCheckType.仅复核;
                }
                else
                {
                    this.SchemeOperationType = EnumCheckType.复核修正复核;
                }
                DialogResult = true;
            }
            else
            {
                DialogResult = false;
            }
        }
    }
}
